import config from "@/config"
import http from "@/utils/request"

export default {
    cust: {
        add: {
            url: `${config.API_URL}/main/crm/cust/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/crm/cust/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/crm/cust/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/crm/cust/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        areTree: {
            url: `${config.API_URL}/core/reportCoreService/query`,
            name: "地区数状图",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        batchEdit: {
            url: `${config.API_URL}/main/crm/custFile/batchEdit`,
            name: "初始化附件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        batchUpdate: {
            url: `${config.API_URL}/main/crm/custFile/batchUpdate`,
            name: "批量更新附件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, {headers: {'Content-Type': 'multipart/form-data'}});
            }
        },
        deleteFile: {
            url: `${config.API_URL}/main/pm/custFile/delete`,
            name: "删除单个附件",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },

    },
    area: {
        add: {
            url: `${config.API_URL}/main/crm/area/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/crm/area/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/crm/area/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/crm/area/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        areTree: {
            url: `${config.API_URL}/core/reportCoreService/query`,
            name: "地区数状图",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        }
    },
    rewardset: {
        add: {
            url: `${config.API_URL}/main/fa/rewardset/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/fa/rewardset/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/fa/rewardset/save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/fa/rewardset/update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        }
    },
    supplier: {
        add: {
            url: `${config.API_URL}/main/crm/supplier/add`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        detail: {
            url: `${config.API_URL}/main/crm/supplier/detail`,
            name: "查看",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        save: {
            url: `${config.API_URL}/main/crm/supplier//save`,
            name: "保存",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        },
        update: {
            url: `${config.API_URL}/main/crm/supplier//update`,
            name: "更新",
            post: async function (data, config = {}) {
                return await http.post(this.url, data, config);
            }
        }
    },
}